<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>我要报名</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="${s.base}/js/layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="${s.base}/css/base/base.css" media="all" /></head>

<body class="childrenBody">
<form class="layui-form">
	<input type="hidden" id="id" name="id" value="${webSignUp.id}" />
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;标题</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" name="title" value="${webSignUp.title}" placeholder="请输入标题" lay-verify="required" autocomplete="off" /></div>
	</div>
	<input type="hidden" class="layui-input" name="type" value="${webSignUp.type}" />

	<!--<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;活动类型</label>
		<div class="layui-input-block">
			<select class="form-control" name="type" lay-verify="required" id="type"></select>
		</div>
	</div>-->
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;用户类型</label>
		<div class="layui-input-block">
			<select class="form-control" name="userType" lay-verify="required" id="userType"></select>
		</div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red"></span>&nbsp;&nbsp;封面图片</label>
		<div class="layui-input-block">
			<!--单图片开始-->
			<div class="layui-input-block cy-uploadpic-ctn" id="picture"  style=" float:left;margin:10px 0!important;position:relative; width: 90px; height: 90px;">
			</div>
			<!--单图片结束-->
		</div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;开始日期</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" id="startDate" name="startDate" value="${(webSignUp.startDate?string('yyyy-MM-dd'))!''}" placeholder="请输入开始日期" lay-verify="required" autocomplete="off" /></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;截止日期</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" id="endDate" name="endDate" value="${(webSignUp.endDate?string('yyyy-MM-dd'))!''}" placeholder="请输入截止日期" lay-verify="required" autocomplete="off" /></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
	<label class="layui-form-label">
		<span class="red">*</span>&nbsp;&nbsp;最小年龄</label>
	<div class="layui-input-block">
		<input type="number" class="layui-input" id="startAge" name="startAge" value="${webSignUp.startAge!'0'}" placeholder="请输入最小年龄，如果是0,表示不做限制！" lay-verify="required" autocomplete="off" /></div>
</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;最大年龄</label>
		<div class="layui-input-block">
			<input type="number" class="layui-input" id="endAge" name="endAge" value="${webSignUp.endAge!'0'}" placeholder="请输入最大年龄，如果是0,表示不做限制！" lay-verify="required" autocomplete="off" /></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;内容</label>
		<div class="layui-input-block">
			<textarea class="layui-textarea" name="content"  id="content" lay-verify="content" placeholder="请输入内容">${webSignUp.content}</textarea></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;状态</label>
		<div class="layui-input-block">
			<select class="form-control" name="status" lay-verify="required" id="status"></select>
		</div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;排序</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" name="sort" value="${webSignUp.sort}" placeholder="请输入排序" lay-verify="required" autocomplete="off" /></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<div class="layui-input-block">
			<button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="submitBtn">确定</button>
			<button type="reset" class="layui-btn layui-btn-sm layui-btn-primary cancel">取消</button></div>
	</div>
</form>
<script type="text/javascript" src="${s.base}/js/layui/layui.js"></script>
<script type="text/javascript" src="${s.base}/js/base/base.js"></script>
<script type="text/javascript" src="${s.base}/lib/KnifeZ/ace/ace.js"  charset="utf-8"></script>
<script type="text/javascript">
	layui.use(['form', 'jquery', 'baseUtil', 'pageUtil', 'laydate','fileUtil','richTxtUtil'],
    function() {
        var form = layui.form,
            $ = layui.jquery,
            baseUtil = layui.baseUtil,
            richTxtUtil = layui.richTxtUtil,
            fileUtil = layui.fileUtil,
            laydate = layui.laydate,
            pageUtil = layui.pageUtil;
        laydate.render({
            elem: '#startDate'
        });
        laydate.render({
            elem: '#endDate'
        });
        //KnifeZ富文本
        var index=richTxtUtil.layeditKnifezBuild("content",300);
        //单图片上传
        fileUtil.uploadImageNoSave('picture',"web/signUp","${webSignUp.picture}");
        pageUtil.initDict("sign_up_type,base_status,web_user_type",
            function(dictData) {
                pageUtil.showDict($("#userType"), pageUtil.aceeptDictContentList(dictData, "web_user_type"), "", '${webSignUp.userType}');
                pageUtil.showDict($("#type"), pageUtil.aceeptDictContentList(dictData, "sign_up_type"), "", '${webSignUp.type}');
                pageUtil.showDict($("#status"), pageUtil.aceeptDictContentList(dictData, "base_status"), "", '${webSignUp.status}');
            });
        form.on('submit(submitBtn)',
            function(data) {
                data.field.content=richTxtUtil.layeditBuildContent(index);
                baseUtil.postMethodResult("/webSignUp/addOrUpdate", data.field,
                    function(result) {
                        parent.location.reload();
                    });
                return false;
            });
    });</script>
</body>

</html>